<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var data = new Date(); 
        data.setDate(1);
        data.setHours(0);
        data.setSeconds(0);
        data.setMinutes(0);
        var datas = new Date(); 
        if (data.getMonth() == 11){
            datas.setMonth(0)
        }else{
            datas.setMonth(data.getMonth() + 1)
        }
        datas.setDate(1);
        datas.setHours(0);
        datas.setSeconds(0);
        datas.setMinutes(0);
        var timeEnd = parseInt(datas.getTime() / 1000 )- 1;
        console.log(timeEnd)
    </script>
</body>
</html>